package com.xu.boot.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xu.boot.mybatisplus.entity.ShortUrlInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 短地址信息表 Mapper 接口
 * </p>
 *
 * @author xuguan
 * @since 2024-05-25
 */
@Mapper
public interface ShortUrlInfoMapper extends BaseMapper<ShortUrlInfoEntity> {

    ShortUrlInfoEntity selectByIdOrShortUrl(@Param("id") Long id,
                                            @Param("shortUrl") String shortUrl);

    List<ShortUrlInfoEntity> selectPage(@Param("pageOffset") Integer pageOffset,
                                        @Param("pageSize") Integer pageSize);

    List<ShortUrlInfoEntity> batchDeleteById(@Param("ids") List<Integer> ids);

    int batchUpdateById(@Param("shortUrlInfoEntityList") List<ShortUrlInfoEntity> shortUrlInfoEntityList);

    int updateShortUriInfoById(@Param("shortUrlInfoEntity") ShortUrlInfoEntity shortUrlInfoEntity);
}
